﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Threading;
using System.Windows.Media.Imaging;

using System.Text;
using System.Threading;
using System.Collections;
using System.Runtime.InteropServices;

using Algorithms;

namespace GameEngine
{
    public class PlayerCharacter:Character
    {
       
        /// <summary>
        ///     Creates new player character with unique ID;
        /// </summary>
        public PlayerCharacter()
        {
            this._id = GetNextID();
        }


        /// <summary>
        ///     Handles mouse input. Changes the destination the character moves to.
        /// </summary>
        public void MouseInput(IntPoint destination, IntSize tileSize)
        {
            //this._path = this.PathFinderGround.FindPath(new IntPoint((this.Position.X) / tileSize.Width, (this.Position.Y) / tileSize.Height), new IntPoint(destination.X / tileSize.Width, destination.Y / tileSize.Height));
            this._path = this.PathFinderGround.FindPath(new IntPoint((this.Position.X + this._baseOffset.X)/tileSize.Width, (this.Position.Y + this._baseOffset.Y)/tileSize.Height), new IntPoint(destination.X/tileSize.Width, destination.Y/tileSize.Height));
        }


        /// <summary>
        ///     Moves the player character.
        /// </summary>
        public override void Move(TimeSpan elapsedTime, IntSize tileSize)
        {
            //calls the base.Move to do other things
            base.Move(elapsedTime, tileSize);
        }
    }
}
